/*
 * 
 *
 *
 */
package com.hboxs.asl.service;

import com.hboxs.asl.Page;
import com.hboxs.asl.Pageable;
import com.hboxs.asl.entity.Member;
import com.hboxs.asl.entity.Question;
import com.pingplusplus.model.Charge;

import java.util.List;

/**
 * Service - 提问问题
 */
public interface QuestionService extends BaseService<Question, Long> {

    /**
     * 根据订单编号查找
     * @param sn
     * @return
     */
    Question findBySn(String sn);

    /**
     * 处理支付
     *
     * @param charge ping++charge对象
     * @param question  订单
     */
    void dealQuestion(Charge charge, Question question);

    /**
     * 处理支付
     *
     * @param question  订单
     */
    void dealQuestion(Question question);

    Page<Question> findQuestionPage(Pageable pageable, Member member, Question.PaymentStatus paymentStatus, Question.AnswerStatus answerStatus);

    Page<Question> findQuestionPage(Pageable pageable, Member member, Question.PaymentStatus paymentStatus);

    Page<Question> findQuestionByTeacher(Pageable pageable, Member teacher, Question.PaymentStatus paymentStatus, Question.AnswerStatus answerStatus);

    Page<Question> findPageGroup(Pageable pageable, Question.PaymentStatus paymentStatus, Question.AnswerStatus answerStatus);

    Page<Question> findQuestionPage(Pageable pageable, Member member);

    Page<Question> findPageByPayment(Pageable pageable);

    Page<Question> findPageByAnswer(Pageable pageable);

    List<Question> findQuestionList();

    long getQuestionCount(Question.AnswerStatus answerStatus);

    /**
     * 我的回答数
     * @param teacher
     * @return
     */
    long myAnswerCounts(Member teacher);

}
